#region Using References

using System;
using System.Diagnostics.Contracts;
using System.IO;

#endregion

namespace Beaker.OpenCube.NbtEditor.ViewModels
{
	class FileSelectorViewModel
		: ViewModel
	{
		static FileSelectorViewModel()
		{
			// set default path to the minecraft folder
			_activePath =
				Path.Combine(
					Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData ),
					".minecraft"
				);
		}

		private static string _activePath;

		/// <summary>
		/// Gets or sets the active path.
		/// </summary>
		/// <value>
		/// The active path.
		/// </value>
		public string ActivePath
		{
			get
			{
				Contract.Ensures( Contract.Result<string>() == _activePath, "Return value should equal the stored active path" );
				return _activePath;
			}
			set
			{
				Contract.Ensures( _activePath == value, "The given path should be stored as the current active path" );

				if( _activePath != value )
				{
					_activePath = value;
					RaisePropertyChanged( () => ActivePath );
				}
			}
		}

		private string _resultPath;

		/// <summary>
		/// Gets or sets the resulting path.
		/// </summary>
		/// <value>
		/// The resulting path.
		/// </value>
		public string ResultPath
		{
			get
			{
				Contract.Ensures( Contract.Result<string>() == _resultPath, "The returned value should equal the stored selected path" );
				return _resultPath;
			}
			set
			{
				Contract.Ensures( _resultPath == value, "The given path should be stored as the selected result path" );
				SetAndRaiseIfChanged( ref _resultPath, value );
			}
		}
	}
}